-
Notifications
You must be signed in to change notification settings - Fork 16
[Fix] #542 - /poke/friend 404 에러 처리 #543
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
놓친 부분까지 꼼꼼하게 발견해주셔서 감사합니다~!
}.store(in: cancelBag) | ||
} else { | ||
owner.onAppServiceCellTapped?(model.deepLink) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 부분은 함수로 분리해주시면 좋을 것 같아요~!!
글고 serviceName으로 기능을 필터링하는 게 별로 좋아보이지는 않는데... service type을 관리하는 enum 만드는 건 어떻게 생각하세요? 저희가 서비스 네임까지 전부 서버에서 내려주는 값에 의존하기로 한 건 클라에서의 분기를 최소화하기 위함이었는데, 어쩔 수 없이 이렇게 클라에서 분기해야 할 필요가 있다면 (문자열이 아닌) 의미 단위로 분기할 수 있도록 enum에 맵핑해주는 게 좋을 것 같아요
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
맞아요. 원래 Core 모듈 내 AppServiceType
을 활용하려고 했는데, 해당 enum을 HomeFeature에 맞게 변경하려면 홈 개편 전인 MainFeature 부분도 수정해야해서 사용 보류했습니다! #540 에서 MainFeature 코드 삭제 후에 기존 Enum 적용해서 수정하도록 할게요! 좋은 의견 감사합니다👍
🌴 PR 요약
콕찌르기 진입 시 발생하는 에러를 방지하기 위한 분기 처리를 추가했습니다.
🌱 작업한 브랜치
🌱 PR Point
✅ 문제 원인
#533 이슈를 해결하는 과정에서 콕찌르기 진입 시마다, 에러가 발생하는 것을 확인했습니다. 원인은 기존 로직의 잘못된 분기 처리였습니다.
기존 콕찌르기 진입 흐름:
home/poke
)pokeMainVC
로드viewDidLoad
에서 세 가지 API 호출(/poke/friend
)/poke/new
를 호출하여 신규 유저 여부 확인이 흐름에서 신규 유저의 경우, 이미
PokeMainVC
가 메모리에 로드 된 뒤 온보딩으로 화면 전환되기 때문에 친구 데이터가 존재하지 않아 /poke/friend API에서 404에러가 발생하고 있었습니다.✅ 문제 해결
PokeMainVC
가 메모리에 올라가기 전인 홈 뷰모델에서 /poke/new 로 신규 유저 여부를 판단하고,신규 유저면 → 온보딩,
기존 유저면 → 메인으로 분기되도록 처리했습니다.
✅ 고려 사항
다른 경로로
PokeMainVC
가 호출될 수 있기 때문에, 기존PokeMainViewModel
의 분기 처리 로직은 삭제하지 않았습니다.우선 지금까지 떠올린 경우의 수는 세 가지 입니다.
1️⃣ 홈뷰에서 진입
딥링크를 사용하지 않고
isNewUser
에 따라 분기처리 해줌(해당 이슈에서 수정)2️⃣ 알림으로 진입
PokeNotificationViewController
로 이동푸시알림을 통해 이동한 경우, 딥링크를 사용하기 때문에
pokeMain
을 로드하게 됨3️⃣ 솝마디를 통해 진입
PokeOnboarding 또는 PokeMain으로 진입하지 않음.
이 중에서 2번의 경우를 때문에 기존 로직의 코드를 남겨두었습니다.(#533 이슈를 해결하려면 아직 친구관계가 없는 상황이 필요해 확인하지 못했어요.)
혹시 제가 떠올리지 못한 경우가 있다면 알려주세요!
📌 참고 사항
HomeForMemberViewModel
에서 콕찌르기 분기처리 부분의 코드를 더 깔끔하게 작성할 수 있는 방법이 있을까요?📮 관련 이슈